home *** CD-ROM | disk | FTP | other *** search
/ PC go! 2008 April / PCgo 2008-04 (DVD).iso / interface / contents / demoversionen_3846 / 13664 / files / Data1.cab / unit1.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  2001-10-16  |  20.4 KB  |  603 lines

  1. unit Unit1;
  2.  
  3. interface
  4.  
  5. uses
  6.   OleAuto,
  7.   Forms,
  8.   Controls,
  9.   Unit2; { Smart Objects: Access to TFrmSample }
  10.  
  11.  
  12. {****************************************************************}
  13. {                                                                }
  14. {                      TurboCAD for Windows                      }
  15. {                   Copyright (c) 1993 - 1997                    }
  16. {             International Microcomputer Software, Inc.         }
  17. {                            (IMSI)                              }
  18. {                      All rights reserved.                      }
  19. {                                                                }
  20. {****************************************************************}
  21.  
  22. type
  23.   TRoundedRect = class(TAutoObject)
  24.   private
  25.     { Private declarations }
  26.     MyForm: TFrmSample; { Property Page form }
  27.     function GetDescription: string;
  28.     function GetClassID: string;
  29.   automated
  30.     { Automated declarations }
  31.         { Smart Objects: Required properties and methods for Regen Methods }
  32.     property Description: string read GetDescription;
  33.     property ClassID: string read GetClassID;
  34.     function GetEnumNames(PropID: Integer; var Names: Variant;
  35.          var Values: Variant): Integer;
  36.     function GetPageInfo(AGraphic: Variant; var StockPages: Integer;
  37.          var Names: Variant): Integer;
  38.     function GetPropertyInfo(var Names: Variant; var Types: Variant;
  39.          var IDs: Variant; var Defaults: Variant): Integer;
  40.     function GetWizardInfo(var Names: Variant): Integer;
  41.     function Draw(GrfThis: Variant; View: Variant; mat: Variant)
  42.         : WordBool;
  43.     procedure OnGeometryChanged(Graphic: Variant; GeomID: Longint;
  44.                  paramOld: Variant; paramNew: Variant);
  45.     function OnGeometryChanging(Graphic: Variant; GeomID: Integer;
  46.                  paramOld: Variant; paramNew: Variant): WordBool;
  47.     function OnNewGraphic(grfThis: Variant; boolCopy: WordBool): WordBool;
  48.     function OnCopyGraphic(grfCopy: Variant; grfSource: Variant): WordBool;
  49.     procedure OnPropertyChanged(Graphic: Variant; PropID: Integer;
  50.                         OldValue: Variant; NewValue: Variant);
  51.     function OnPropertyChanging(Graphic: Variant; PropID: Integer;
  52.             OldValue: Variant; NewValue: Variant): WordBool;
  53.     procedure OnPropertyGet(Graphic: Variant; PropID: Integer);
  54.     function PageControls(ThisRegenMethod: Variant; Graphic: Variant; PageNumber: Integer;
  55.          SaveProperties: WordBool): WordBool;
  56.     procedure PageDone(ThisRegenMethod: Variant; PageNumber: Variant);
  57.     function PropertyPages(ThisRegenMethod: Variant; PageNumber: Variant): WordBool;
  58.     procedure Regen(grfThis: Variant);
  59.     function Wizard(ThisRegenMethod: Variant; WizardNumber: Variant): WordBool;
  60.   end;
  61.  
  62. {$IFNDEF TARGET_EXE}
  63. { DLL Note:  GetServerProgIDs is a required export for use by TurboCAD. }
  64. { It is needed because Delphi does not create type libraries. }
  65. function GetServerProgIDs(var ProgIDs: Variant) : Integer;Pascal;export;
  66.  
  67. { EXE Note:  Comment these exports out if building an EXE Automation server. }
  68. { Required exports for .DLL servers and TurboCAD Delphi extensions. }
  69. exports
  70.        DllGetClassObject, DllCanUnloadNow,
  71.        DllRegisterServer, DllUnregisterServer,
  72.        GetServerProgIDs;
  73. {$ENDIF}
  74.  
  75. implementation
  76.  
  77. uses SysUtils, Dialogs;  { Required for StrToFloat, etc. }
  78.  
  79. const
  80.   { Smart Objects: Make AutoClassInfo accessible to other functions }
  81.   { Needed because Delphi does not create type libraries }
  82.   AutoClassInfo: TAutoClassInfo = (
  83.     AutoClass: TRoundedRect;
  84.     ProgID: 'RRect.TRoundedRect';
  85.     ClassID: '{4EA25981-A43C-11D0-A115-00A024158DAF}';
  86.     Description: 'Sample Smart Object Rounded Rectangle Example';
  87.     Instancing: acMultiInstance);
  88.  
  89. { DBAPI constants }
  90.   gkGraphic = 11;
  91.   gkArc = 2;
  92.   gkText = 6;
  93.   gfCosmetic = 128;
  94.  
  95. { Useful math constants }
  96.   Pi: double = 3.14159265;
  97.  
  98. { Special variant types }
  99.   typeIntegerEnum = varSmallint + 100;
  100.   typeLongEnum = varInteger + 100;
  101.   typeStringEnum = varOleStr + 100;
  102.  
  103. { Stock property pages }
  104.   ppStockPen = 1;
  105.   ppStockBrush = 2;
  106.   ppStockText = 4;
  107.   ppStockInsert = 8;
  108.   ppStockViewport = 16;
  109.   ppStockAuto = 32;
  110.  
  111. { Property Ids }
  112.   idRoundness = 1;
  113.  
  114. { Property enums }
  115.  
  116. { Number of properties, pages, wizards }
  117.   NUM_PROPERTIES = 1;
  118.   NUM_PAGES = 1;
  119.   NUM_WIZARDS = 0;
  120.  
  121. { TRoundedRect object methods }
  122.  
  123. { Returns the user-visible description of this RegenMethod }
  124. function TRoundedRect.GetDescription: string;
  125. begin
  126.     GetDescription := AutoClassInfo.Description;
  127. end;
  128.  
  129. { Returns the persistent class id for this RegenMethod's property section }
  130. function TRoundedRect.GetClassID: string;
  131. begin
  132.     GetClassID := AutoClassInfo.ClassID;
  133. end;
  134.  
  135. { Retrieve types and names }
  136. function TRoundedRect.GetPropertyInfo(var Names: Variant; var Types: Variant;
  137.              var IDs: Variant; var Defaults: Variant): Integer;
  138. begin
  139.    try
  140.       VarArrayRedim(Names, NUM_PROPERTIES);
  141.       VarArrayRedim(Types, NUM_PROPERTIES);
  142.       VarArrayRedim(IDs, NUM_PROPERTIES);
  143.       VarArrayRedim(Defaults, NUM_PROPERTIES);
  144.       Names[0] := 'Roundness';
  145.       Types[0] := varDouble;
  146.       IDs[0] := idRoundness;
  147.       Defaults[0] := 50.0;
  148.       Result := NUM_PROPERTIES;
  149.    except
  150.       Result := 0;
  151.    end;
  152. end;
  153.  
  154. { Get the number of property pages supporting this RegenMethod }
  155. function TRoundedRect.GetPageInfo(AGraphic: Variant; var StockPages: Integer;
  156.          var Names: Variant): Integer;
  157. begin
  158.    VarArrayRedim(Names, NUM_PAGES);
  159.  
  160.    { Need the form }
  161.    MyForm := TFrmSample.Create(Application);
  162.    Names[0] := MyForm.Caption;
  163.    MyForm.Free;
  164.  
  165.    StockPages := ppStockBrush + ppStockPen + ppStockAuto;
  166.    GetPageInfo := NUM_PAGES;
  167. end;
  168.  
  169. { Get the number of wizards supporting this RegenMethod }
  170. function TRoundedRect.GetWizardInfo(var Names: Variant): Integer;
  171. begin
  172.     GetWizardInfo := NUM_WIZARDS;
  173. end;
  174.  
  175. { Enumerate the names and values of a specified property }
  176. function TRoundedRect.GetEnumNames(PropID: Integer; var Names: Variant;
  177.          var Values: Variant): Integer;
  178. begin
  179.     GetEnumNames := 0;
  180. end;
  181.  
  182. function TRoundedRect.PageControls(ThisRegenMethod: Variant; Graphic: Variant; PageNumber: Integer;
  183.          SaveProperties: WordBool): WordBool;
  184. var
  185.    Roundness: double;
  186. begin
  187.      try
  188.         if SaveProperties then
  189.         begin
  190.             { OK button on property page was clicked }
  191.             { Form is still loaded }
  192.             with MyForm do
  193.             begin
  194.                 { Need try block for the case where you have }
  195.                 { TRoundedRect Turbo Shape and ahother "shape" selected }
  196.                 try
  197.                    { When the property page is closed, transfer the numeric }
  198.                    { roundness value from the EditBox to the Graphic }
  199.                    { Get the value as a double-precision number }
  200.                    Roundness := StrToFloat(txtRoundness.Text);
  201.  
  202.                    { Make sure it's between 0 and 100 }
  203.                    if Roundness < 0.0 then Roundness := 0.0;
  204.                    if Roundness > 100.0 then Roundness := 100.0;
  205.                    { Set the roundness property value in the Graphic }
  206.                    Graphic.Properties['Roundness'] := Roundness;
  207.                 except
  208.                 end;
  209.             end;
  210.         end
  211.         else
  212.         begin
  213.             { Property page is about to be opened }
  214.             { Make sure the form is loaded }
  215.             MyForm := TFrmSample.Create(Application);
  216.             with MyForm do
  217.             begin
  218.                 { If more than one TRoundedRect is selected and they do not }
  219.                 { have the same properties, don't set up this field }
  220.                 try
  221.  
  222.                     { When the property page is opening, transfer the numeric }
  223.                     { roundness value from the Graphic to the TextBox }
  224.                     { Get the roundness property value from the Graphic }
  225.                     Roundness := Graphic.Properties['Roundness'];
  226.                     { Set the EditBox control's text }
  227.                         txtRoundness.Text := FloatToStrF(Roundness, ffGeneral,
  228.                                    3, 0);
  229.                 except
  230.                 end;
  231.             end;
  232.         end;
  233.         PageControls := True;
  234.      except
  235.         { For debugging purposes, report that an error occurred }
  236.         { Return false if an error occurred }
  237.         PageControls := False;
  238.      end;
  239. end;
  240.  
  241. procedure TRoundedRect.PageDone(ThisRegenMethod: Variant; PageNumber: Variant);
  242. begin
  243.         { Done with form }
  244.         MyForm.Free;
  245. end;
  246.  
  247. function TRoundedRect.PropertyPages(ThisRegenMethod: Variant; PageNumber: Variant): WordBool;
  248. var
  249.    PageResult: Integer;
  250. begin
  251.     with MyForm do
  252.     begin
  253.         PageResult := ShowModal;
  254.         PropertyPages := (PageResult = mrOk);
  255.     end;
  256. end;
  257.  
  258. function TRoundedRect.Wizard(ThisRegenMethod: Variant; WizardNumber: Variant): WordBool;
  259. begin
  260.     Wizard := False;
  261. end;
  262.  
  263. { Called when vertex has been moved, or other geometry change }
  264. procedure TRoundedRect.OnGeometryChanged(Graphic: Variant; GeomID: Longint;
  265.     paramOld: Variant; paramNew: Variant);
  266. begin
  267.     { Do nothing }
  268. end;
  269.  
  270. { Called when vertex is moved, or other geometry change }
  271. function TRoundedRect.OnGeometryChanging(Graphic: Variant; GeomID: Integer;
  272.     paramOld: Variant; paramNew: Variant): WordBool;
  273. begin
  274.     { OK to continue with change }
  275.     OnGeometryChanging := True;
  276. end;
  277.  
  278. function TRoundedRect.OnNewGraphic(grfThis: Variant; boolCopy: WordBool): WordBool;
  279. var
  280.    R, Roundness, Offset: double;
  281.    Vertices, vTrue, vFalse: Variant;
  282.    X, Y, Z: double;
  283. begin
  284.     if boolCopy then
  285.     begin
  286.         { Vertices are already added for us... }
  287.         OnNewGraphic := True;
  288.         exit;
  289.     end;
  290.  
  291.     try
  292.         { New Graphic being created }
  293.         { Temporary veriable for Vertices.Add }
  294.         Vertices := grfThis.Vertices;
  295.  
  296.         { Define True and False variants }
  297.         vTrue := True;
  298.         vFalse := False;
  299.  
  300.         { First Vertex is "lower left" corner }
  301.         { Arguments for Vertices.Add are:
  302.         { X, Y, Z: double; }
  303.         { PenDown, Selectable, Snappable, Editable, Linkable, Calculated, }
  304.         { Before, After: Variant. }
  305.         { Specify all flags;  Omit Before and After arguments. }
  306.         X := -1.0;
  307.         Y := -0.5;
  308.         Z := 0.0;
  309.         Vertices.Add(X, Y, Z,
  310.             vFalse, vTrue, vFalse, vFalse, vFalse, vFalse, , );
  311.  
  312.         { Second Vertex is "upper right" corner }
  313.         X := 1.0;
  314.         Y := 0.5;
  315.         Vertices.Add(X, Y, Z,
  316.             vFalse, vTrue, vFalse, vFalse, vFalse, vFalse, , );
  317.  
  318.         { Third Vertex is rounding handle (calculated) }
  319.         Roundness := grfThis.Properties['Roundness'];
  320.         R := 0.5 * Roundness / 100.0;
  321.         Offset := 0.1 * R;
  322.         X := 1.0 - R;
  323.         Y := 0.5 + Offset;
  324.            Vertices.Add(X, Y, Z,
  325.             vFalse, vFalse, vFalse, vFalse, vFalse, vFalse, , );
  326.  
  327.         { Fourth Vertex is rounding handle (editable) }
  328.            Vertices.Add(X, Y, Z,
  329.             vFalse, vTrue, vFalse, vTrue, vFalse, vFalse, , );
  330.         OnNewGraphic := True;
  331.     except
  332.     { Return false on failure }
  333.         OnNewGraphic := False;
  334.     end;
  335. end;
  336.  
  337. function TRoundedRect.OnCopyGraphic(grfCopy: Variant; grfSource: Variant): WordBool;
  338. begin
  339.     { OK to proceed }
  340.      OnCopyGraphic := True;
  341. end;
  342.  
  343. { Notification function called after graphic property is saved }
  344. procedure TRoundedRect.OnPropertyChanged(Graphic: Variant; PropID: Integer;
  345.         OldValue: Variant; NewValue: Variant);
  346. begin
  347.     { Do nothing }
  348. end;
  349.  
  350. { Notification function called when graphic property is saved }
  351. function TRoundedRect.OnPropertyChanging(Graphic: Variant; PropID: Integer;
  352.         OldValue: Variant; NewValue: Variant): WordBool;
  353. begin
  354.     { OK to proceed }
  355.     OnPropertyChanging := True;
  356. end;
  357.  
  358. { Notification function called when graphic property is retrieved }
  359. procedure TRoundedRect.OnPropertyGet(Graphic: Variant; PropID: Integer);
  360. begin
  361.     { Do nothing }
  362. end;
  363.  
  364.  
  365. { Called when graphic's internal structure needs to be updated }
  366. procedure TRoundedRect.Regen(grfThis: Variant);
  367. var
  368.     LockCount: Integer;
  369.     boolHandleMoved: WordBool;
  370.     W, H, R, Roundness: double;
  371.     X, Y, Z, X0, Y0, X1, Y1, T, StartAngle, EndAngle: double;
  372.         Props, propRoundness: Variant;
  373.         grfChild, Vertices, V0, V1, V2, V3, vTrue, vFalse: Variant;
  374. begin
  375.   { Setup error handler }
  376.   try
  377.      { Set up lock (prevent recursion) }
  378.      LockCount := grfThis.RegenLock;
  379.  
  380.      { Setup error handler (make sure lock is removed) }
  381.      if LockCount = 0 then
  382.      begin
  383.          try
  384.             { Delete any previous cosmetic children }
  385.             grfThis.Graphics.Clear(gfCosmetic);
  386.  
  387.             { Calculate height, width and radius of corners }
  388.             Vertices := grfThis.Vertices;
  389.             V0 := Vertices.Item[0]; { First corner }
  390.             V1 := Vertices.Item[1]; { Diagonal corner }
  391.             V2 := Vertices.Item[2]; { Radius }
  392.             V3 := Vertices.Item[3]; { Drag handle }
  393.  
  394.             if (Abs(V2.X - V3.X) < 0.000001) and
  395.                (Abs(V2.Y - V3.Y) < 0.000001) then boolHandleMoved := False
  396.             else boolHandleMoved := True;
  397.  
  398.             W := Abs(V1.X - V0.X);
  399.             H := Abs(V1.Y - V0.Y);
  400.  
  401.             { Radius of arcs is based on minimum of width and height }
  402.             if W < H then R := W / 2.0
  403.             else R := H / 2.0;
  404.  
  405.             { Adjust radius for roundness }
  406.             Props := grfThis.Properties;
  407.             propRoundness := Props.Item['Roundness'];
  408.             if boolHandleMoved then
  409.             begin
  410.                 Roundness := Abs(V2.X - V3.X);
  411.                 Roundness := Roundness * 100.0 / R;
  412.                 if Roundness > 100.0 then Roundness := 100.0;
  413.                 { Relocate handle }
  414.  
  415.                 { Update property to reflect handle location }
  416.                 propRoundness.Value := Roundness;
  417.             end
  418.             else
  419.             begin
  420.                 Roundness := propRoundness.Value;
  421.                 if Roundness < 0.0 then Roundness := 0.0;
  422.                 if Roundness > 100.0 then Roundness := 100.0;
  423.             end;
  424.             R := R * Roundness / 100.0;
  425.  
  426.             { Add child Graphics }
  427.             X0 := V0.X;
  428.             Y0 := V0.Y;
  429.             X1 := V1.X;
  430.             Y1 := V1.Y;
  431.             { Make sure X0 < X1 }
  432.             if X0 > X1 then
  433.             begin
  434.                 T := X0;
  435.                 X0 := X1;
  436.                 X1 := T;
  437.             end;
  438.             { Make sure Y0 < Y1 }
  439.             if Y0 > Y1 then
  440.             begin
  441.                 T := Y0;
  442.                 Y0 := Y1;
  443.                 Y1 := T;
  444.             end;
  445.  
  446.             vTrue := True;
  447.             vFalse := False;
  448.             if R = 0 then
  449.             begin
  450.                 { No rounded corners }
  451.                 { All children are cosmetic }
  452.                 grfChild := grfThis.Graphics.Add( , , vTrue, , , );
  453.                 grfChild.Cosmetic := True;
  454.                 { Now add vertices to the child }
  455.                 Vertices := grfChild.Vertices;
  456.                 X := X0;
  457.                 Y := Y0;
  458.                 Z := 0.0;
  459.                 Vertices.Add(X, Y, Z, , , , , , , , );
  460.                 Y := Y1;
  461.                 Vertices.Add(X, Y, Z, vTrue, , , , , , , );
  462.                 X := X1;
  463.                 Vertices.Add(X, Y, Z, vTrue, , , , , , , );
  464.                 Y := Y0;
  465.                 Vertices.Add(X, Y, Z, vTrue, , , , , , , );
  466.                 { Close the rectangle }
  467.                 Vertices.AddClose(vTrue, , , , , );
  468.             end
  469.             else
  470.             begin
  471.                 { Rounded corners }
  472.                 { We'll make 4 line children and 4 arc children }
  473.                 { First line }
  474.                 { All children are cosmetic }
  475.                 grfChild := grfThis.Graphics.Add( , , vTrue, , , );
  476.                 grfChild.Cosmetic := True;
  477.                 { Now add vertices to the child }
  478.                 Vertices := grfChild.Vertices;
  479.                 X := X0 + R;
  480.                 Y := Y0;
  481.                 Z := 0;
  482.                 Vertices.Add(X, Y, Z, , , , , , , , );
  483.                 X := X1 - R;
  484.                 Vertices.Add(X, Y, Z, vTrue, , , , , , , );
  485.                 { First arc }
  486.                 grfChild := grfThis.Graphics.Add(gkArc, , vTrue, , , );
  487.                 grfChild.Cosmetic := True;
  488.                 Y := Y0 + R;
  489.                 StartAngle := 1.5 * Pi;
  490.                 EndAngle := 0.0;
  491.                 grfChild.ArcSet(X, Y, Z, R, , StartAngle, EndAngle, );
  492.                 { Second line }
  493.                 grfChild := grfThis.Graphics.Add( , , vTrue, , , );
  494.                 grfChild.Cosmetic := True;
  495.                 Vertices := grfChild.Vertices;
  496.                 X := X1;
  497.                 Vertices.Add(X, Y, Z, , , , , , , , );
  498.                 Y := Y1 - R;
  499.                 Vertices.Add(X, Y, Z, vTrue, , , , , , , );
  500.                 { Second arc }
  501.                 grfChild := grfThis.Graphics.Add(gkArc, , vTrue, , , );
  502.                 grfChild.Cosmetic := True;
  503.                 X := X1 - R;
  504.                 StartAngle := 0.0;
  505.                 EndAngle := 0.5 * Pi;
  506.                 grfChild.ArcSet(X, Y, Z, R, , StartAngle, EndAngle, );
  507.                 { Third line }
  508.                 grfChild := grfThis.Graphics.Add( , , vTrue, , , );
  509.                 grfChild.Cosmetic := True;
  510.                 Vertices := grfChild.Vertices;
  511.                 Y := Y1;
  512.                 Vertices.Add(X, Y, Z, , , , , , , , );
  513.                 X := X0 + R;
  514.                 Vertices.Add(X, Y, Z, vTrue, , , , , , , );
  515.                 { Third arc }
  516.                 grfChild := grfThis.Graphics.Add(gkArc, , vTrue, , , );
  517.                 grfChild.Cosmetic := True;
  518.                 Y := Y1 - R;
  519.                 StartAngle := 0.5 * Pi;
  520.                 EndAngle := Pi;
  521.                 grfChild.ArcSet(X, Y, Z, R, , StartAngle, EndAngle, );
  522.                 { Fourth line }
  523.                 grfChild := grfThis.Graphics.Add( , , vTrue, , , );
  524.                 grfChild.Cosmetic := True;
  525.                 Vertices := grfChild.Vertices;
  526.                 X := X0;
  527.                 Vertices.Add(X, Y, Z, , , , , , , , );
  528.                 Y := Y0 + R;
  529.                 Vertices.Add(X, Y, Z, vTrue, , , , , , , );
  530.                 { Fourth arc }
  531.                 grfChild := grfThis.Graphics.Add(gkArc, , vTrue, , , );
  532.                 grfChild.Cosmetic := True;
  533.                 X := X0 + R;
  534.                 StartAngle := Pi;
  535.                 EndAngle := 1.5 * Pi;
  536.                 grfChild.ArcSet(X, Y, Z, R, , StartAngle, EndAngle, );
  537.             end;
  538.  
  539.             { Add visible child Graphics }
  540.  
  541.          except
  542.          end;
  543.      end; { if LockCount = 0 }
  544.  
  545.      { Remove lock }
  546.      grfThis.RegenUnlock;
  547.   except
  548.   end;
  549. end;
  550.  
  551. { Called to do special draw proocessing }
  552. function TRoundedRect.Draw(GrfThis: Variant; View: Variant; mat: Variant)
  553.   : WordBool;
  554. begin
  555.     { Return True if we did the redraw (no further processing necessary, }
  556.     { no children will be drawn). }
  557.     { Since this is just a test, we return False to let TurboCAD do the }
  558.     { drawing operation. }
  559.     Draw := False;
  560. end;
  561.  
  562. {$IFNDEF TARGET_EXE}
  563. { DLL Note: GetServerProgIDs is a required function for TurboCAD extensions. }
  564. { EXE Note: Comment out GetServerProgIDs if you are building an EXE server,
  565. { and see the note below regarding required resources. }
  566.  
  567. { In lieu of type library, we need to get the CLSID of the OleAuto }
  568. { object somehow.  Once we have the CLSID, we can merrily call }
  569. { CoCreateInstance to get an object... }
  570. function GetServerProgIDs(var ProgIDs: Variant) : Integer;Pascal;export;
  571. begin
  572.    VarArrayRedim(ProgIDs, 1); { Redimension array }
  573.    ProgIDs[0] := AutoClassInfo.ProgID; { Return ProgID in array element }
  574.    GetServerProgIDs := 1;                  { Return size of array }
  575. end;
  576. {$ELSE}
  577.  
  578. { EXE Note: When building an .EXE server, you should add a resource named }
  579. { "ProgIDs" of type RCDATA with the ProgID strings separated by NUL }
  580. { characters.  For example, this server would contain a resource file }
  581. { generated from the following .RC file: }
  582. {
  583. ProgIDs RCDATA
  584. BEGIN
  585.      "RRect.RoundedRect\0"
  586. END
  587. }
  588. { Save the script in a file called "ProgIds.rc". }
  589. { Compile ProgIds.rc using "Brc32.exe -r ProgIds.rc". }
  590. { Include the resulting .RES file in our project with the $RESOURCE directive. }
  591. { using Delphi's $RESOURCE directive in the DPR file. }
  592.  
  593. {$ENDIF}
  594.  
  595. procedure RegisterRoundedRect;
  596. begin
  597.   Automation.RegisterClass(AutoClassInfo);
  598. end;
  599.  
  600. initialization
  601.   RegisterRoundedRect;
  602. end.
  603.